home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.tree;
-
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
-
- class VariableHeightLayoutCache$VisibleTreeStateNodeEnumeration implements Enumeration {
- // $FF: synthetic field
- private final VariableHeightLayoutCache this$0;
- protected VariableHeightLayoutCache.TreeStateNode parent;
- protected int nextIndex;
- protected int childCount;
-
- protected VariableHeightLayoutCache$VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache var1, VariableHeightLayoutCache.TreeStateNode var2) {
- this(var1, var2, -1);
- }
-
- protected VariableHeightLayoutCache$VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache var1, VariableHeightLayoutCache.TreeStateNode var2, int var3) {
- this.this$0 = var1;
- this.parent = var2;
- this.nextIndex = var3;
- this.childCount = this.parent.getChildCount();
- }
-
- protected boolean findNextValidParent() {
- if (this.parent == VariableHeightLayoutCache.access$2(this.this$0)) {
- this.parent = null;
- return false;
- } else {
- while(this.parent != null) {
- VariableHeightLayoutCache.TreeStateNode var1 = (VariableHeightLayoutCache.TreeStateNode)this.parent.getParent();
- if (var1 != null) {
- this.nextIndex = ((DefaultMutableTreeNode)var1).getIndex(this.parent);
- this.parent = var1;
- this.childCount = this.parent.getChildCount();
- if (this.updateNextIndex()) {
- return true;
- }
- } else {
- this.parent = null;
- }
- }
-
- return false;
- }
- }
-
- public boolean hasMoreElements() {
- return this.parent != null;
- }
-
- public Object nextElement() {
- if (!this.hasMoreElements()) {
- throw new NoSuchElementException("No more visible paths");
- } else {
- TreePath var1;
- if (this.nextIndex == -1) {
- var1 = this.parent.getTreePath();
- } else {
- VariableHeightLayoutCache.TreeStateNode var2 = (VariableHeightLayoutCache.TreeStateNode)this.parent.getChildAt(this.nextIndex);
- var1 = var2.getTreePath();
- }
-
- this.updateNextObject();
- return var1;
- }
- }
-
- protected boolean updateNextIndex() {
- if (this.nextIndex == -1 && !this.parent.isExpanded()) {
- return false;
- } else if (this.childCount == 0) {
- return false;
- } else if (++this.nextIndex >= this.childCount) {
- return false;
- } else {
- VariableHeightLayoutCache.TreeStateNode var1 = (VariableHeightLayoutCache.TreeStateNode)this.parent.getChildAt(this.nextIndex);
- if (var1 != null && var1.isExpanded()) {
- this.parent = var1;
- this.nextIndex = -1;
- this.childCount = ((DefaultMutableTreeNode)var1).getChildCount();
- }
-
- return true;
- }
- }
-
- protected void updateNextObject() {
- if (!this.updateNextIndex()) {
- this.findNextValidParent();
- }
-
- }
- }
-